home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 January: Mac OS SDK / Dev.CD Jan 96 SDK / Dev.CD Jan 96 SDK1.toast / Development Kits (Disc 1) / AOCE / Development Tools / Sample Code / SampleTemplate / Sample Template / Source / AlbumInfoPageLayout.r < prev    next >
Encoding:
Text File  |  1993-09-07  |  7.9 KB  |  249 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        AlbumInfoPage.r
  3.  
  4.     Contains:    Information page resources for album sample template
  5.  
  6.     Written by: Harry Chesley, Steve Fisher, Bruce Gaya
  7.  
  8.     Copyright:    © 1993 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.                   5/6/93    BG        revised for 1993 WWDC
  13.  
  14.     To Do:
  15. */
  16.  
  17. #include "Types.r"
  18. #include "OCETemplates.h"
  19. #include "OCE.r"
  20.  
  21. // --------------------------------------------------------------------
  22. // --------------------------------------------------------------------
  23. //
  24. // Album Main Aspect
  25. //
  26. // --------------------------------------------------------------------
  27. // --------------------------------------------------------------------
  28.  
  29.  
  30. /////////////////////////////////////////////////////////////////////////
  31. //
  32. // BOOKKEEPING - this is an aspect template with this base resource id
  33. //
  34. /////////////////////////////////////////////////////////////////////////
  35.  
  36. #define kAlbumMainAspect        kDETFirstID
  37.  
  38. resource 'deta' (kAlbumMainAspect, purgeable) {
  39.     0,                    // Drop priority
  40.     dropCheckAlways,    // Drop check flag
  41.     isMainAspect        // Is the main aspect
  42. };
  43.  
  44. resource 'rstr' (kAlbumMainAspect+kDETTemplateName, purgeable) {
  45.     "Album Main Aspect"
  46. };
  47.  
  48.  
  49. /////////////////////////////////////////////////////////////////////////
  50. //
  51. // BINDING - associate this aspect with records of this type
  52. //
  53. /////////////////////////////////////////////////////////////////////////
  54.  
  55. resource 'rstr' (kAlbumMainAspect+kDETRecordType, purgeable) {
  56.     "Album"
  57. };
  58.  
  59.  
  60. /////////////////////////////////////////////////////////////////////////
  61. //
  62. // BEHAVIOR - record icon’s behaviour
  63. //
  64. /////////////////////////////////////////////////////////////////////////
  65.  
  66. resource 'rst#' (kAlbumMainAspect+kDETAspectCategory,purgeable)
  67.     {{
  68.     "Recordings"
  69.     }};
  70.  
  71. resource 'rstr' (kAlbumMainAspect+kDETAspectNewMenuName, purgeable) {
  72.     "New Album"
  73. };
  74.  
  75. resource 'rstr' (kAlbumMainAspect+kDETAspectNewEntryName, purgeable) {
  76.     "untitled album"
  77. };
  78.  
  79.  
  80. /////////////////////////////////////////////////////////////////////////
  81. //
  82. // USER INTERFACE RESOURCES - for looking good
  83. //
  84. /////////////////////////////////////////////////////////////////////////
  85.  
  86. resource 'rstr' (kAlbumMainAspect+kDETAspectKind, purgeable) {
  87.     "album (info page)"
  88. };
  89.  
  90. resource 'rstr' (kAlbumMainAspect+kDETAspectWhatIs, purgeable) {
  91.     "Album\n\nA description of an album."
  92. };
  93.  
  94.  
  95. // icons
  96.  
  97. include "AlbumIcons" 'ICN#'(0) as 'ICN#'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  98. include "AlbumIcons" 'icl4'(0) as 'icl4'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  99. include "AlbumIcons" 'icl8'(0) as 'icl8'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  100. include "AlbumIcons" 'ics#'(0) as 'ics#'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  101. include "AlbumIcons" 'ics4'(0) as 'ics4'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  102. include "AlbumIcons" 'ics8'(0) as 'ics8'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  103. include "AlbumIcons" 'SICN'(0) as 'SICN'(kAlbumMainAspect+kDETAspectMainBitmap, purgeable);
  104.  
  105.  
  106. // --------------------------------------------------------------------
  107. // --------------------------------------------------------------------
  108. //
  109. // Album Information Page
  110. //
  111. // --------------------------------------------------------------------
  112. // --------------------------------------------------------------------
  113.  
  114.  
  115. /////////////////////////////////////////////////////////////////////////
  116. //
  117. // BOOKKEEPING - this is an information page template with this base resource id
  118. //                 and this view
  119. //
  120. /////////////////////////////////////////////////////////////////////////
  121.  
  122. #define kAlbumInfoPage            kDETSecondID
  123.  
  124.  
  125. resource 'deti' (kAlbumInfoPage, purgeable) {
  126.     1000,
  127.     {0, 0, 0, 0},
  128.     selectFirstText, 
  129.     {
  130.         kDETNoProperty, kDETNoProperty, kAlbumInfoPage;
  131.     },
  132.     {
  133.     }
  134. };
  135.  
  136. resource 'rstr' (kAlbumInfoPage+kDETTemplateName, purgeable) {
  137.     "Album 1st Info Page"
  138. };
  139.  
  140. resource 'rstr' (kAlbumInfoPage+kDETInfoPageName, purgeable) {
  141.     "General Info"
  142. };
  143.  
  144.  
  145. /////////////////////////////////////////////////////////////////////////
  146. //
  147. // BINDING - associate this information page with records of this type
  148. //             and with this aspect
  149. //
  150. /////////////////////////////////////////////////////////////////////////
  151.  
  152. resource 'rstr' (kAlbumInfoPage+kDETRecordType, purgeable) {
  153.     "Album"
  154. };
  155.  
  156. resource 'rstr' (kAlbumInfoPage+kDETInfoPageMainViewAspect, purgeable) {
  157.     "Album Main Aspect"
  158. };
  159.  
  160.  
  161.  
  162. /////////////////////////////////////////////////////////////////////////
  163. //
  164. // VIEWS - what you see in this information page
  165. //
  166. /////////////////////////////////////////////////////////////////////////
  167.  
  168. #define kCoverTop                        (kDETSubpageIconBottom + 8)
  169. #define kCoverLeft                        (kDETSubpageIconLeft-2)
  170. #define kCoverBottom                    (kCoverTop + 175)
  171. #define kCoverRight                        (kCoverLeft + 175)
  172.  
  173. #define k1stColumnLeft                    (kCoverRight+4)
  174. #define k1stColumnRight                    (k1stColumnLeft+65)
  175. #define k2ndColumnLeft                    (k1stColumnRight+4)
  176. #define k2ndColumnRight                    (kDETRecordInfoWindWidth - 8)
  177.  
  178. #define kTitleTop                        (kCoverTop)
  179. #define kTitleBottom                    (kTitleTop + kDETAppFontLineHeight + 4)
  180. #define kArtistTop                        (kTitleBottom + 6)
  181. #define kArtistBottom                    (kArtistTop + kDETAppFontLineHeight + 4)
  182. #define kFormatTop                        (kArtistBottom + 6)
  183. #define kFormatBottom                    (kFormatTop + kDETAppFontLineHeight + 4)
  184. #define kNumFormats                        (3)
  185. #define kCDRadioLeft                    (k2ndColumnLeft)
  186. #define kCDRadioRight                    (kCDRadioLeft + 35)
  187. #define kCassetteRadioLeft                (kCDRadioRight)
  188. #define kCassetteRadioRight                (kCassetteRadioLeft + 60)
  189. #define kVinylRadioLeft                    (kCassetteRadioRight)
  190. #define kVinylRadioRight                (k2ndColumnRight)
  191. #define kCommentsTop                    (kFormatBottom + 32)
  192. #define kCommentsLabelBottom            (kCommentsTop + kDETAppFontLineHeight + 4)
  193. #define kCommentsBottom                    (kCoverBottom)
  194.  
  195.  
  196. resource 'detv' (kAlbumInfoPage, purgeable) {
  197.     {
  198.     kDETSubpageIconRect, kDETNoFlags, kDETAspectMainBitmap,
  199.     Bitmap { kDETLargeIcon };
  200.  
  201.  
  202.     {kTitleTop, k1stColumnLeft, kTitleBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  203.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  204.         "Full title:" };
  205.     
  206.     {kTitleTop-2, k2ndColumnLeft, kTitleBottom-2, k2ndColumnRight}, kDETEnabled, kDETNoProperty,
  207.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  208.  
  209.  
  210.     {kArtistTop, k1stColumnLeft, kArtistBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  211.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  212.         "Artist:" };
  213.  
  214.     {kArtistTop-2, k2ndColumnLeft, kArtistBottom-2, k2ndColumnRight}, kDETEnabled, kDETNoProperty,
  215.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  216.  
  217.  
  218.     {kFormatTop, k1stColumnLeft, kFormatBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  219.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  220.         "Format:" };
  221.  
  222.     {kFormatTop, kCDRadioLeft, kFormatBottom, kCDRadioRight}, kDETEnabled, kDETNoProperty,
  223.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  224.             "CD", kDETNoProperty, 1 };
  225.  
  226.     {kFormatTop, kCassetteRadioLeft, kFormatBottom, kCassetteRadioRight}, kDETEnabled, kDETNoProperty,
  227.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  228.             "Cassette", kDETNoProperty, 2 };
  229.  
  230.     {kFormatTop, kVinylRadioLeft, kFormatBottom, kVinylRadioRight}, kDETEnabled, kDETNoProperty,
  231.     RadioButton { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal, 
  232.             "Vinyl", kDETNoProperty, 3 };
  233.  
  234.     {kCommentsTop, k1stColumnLeft, kCommentsLabelBottom, k1stColumnRight}, kDETNoFlags, kDETNoProperty,
  235.     StaticTextFromView { kDETApplicationFont, kDETApplicationFontSize, kDETRight, kDETBold,
  236.         "Comments:" };
  237.  
  238.     {kCommentsLabelBottom, k1stColumnLeft, kCommentsBottom-2, k2ndColumnRight}, kDETEnabled + kDETMultiLine, kDETNoProperty,
  239.     EditText { kDETApplicationFont, kDETApplicationFontSize, kDETLeft, kDETNormal };
  240.  
  241.     { kCoverTop, kCoverLeft, kCoverBottom, kCoverRight }, kDETNoFlags, kDETNoProperty,
  242.         Box { kDETBoxIsGrayed };
  243.  
  244.     { kCoverTop, kCoverLeft, kCoverBottom, kCoverRight }, kDETNoFlags, kDETNoProperty,
  245.     EditPicture { 8 };
  246.     }
  247. };
  248.  
  249.